@dss-kit/ui-kit 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/components/builders/Modal/Modal.js +57 -51
  2. package/dist/components/builders/Modal/ModalHeader/ModalHeader.js +27 -27
  3. package/dist/components/builders/Modal/styles.d.ts +0 -1
  4. package/dist/components/builders/Modal/styles.js +6 -12
  5. package/dist/components/builders/Table/TablePagination/TablePagination.js +1 -1
  6. package/dist/components/charts/LineChart/LineChart.js +17 -15
  7. package/dist/components/charts/PieProgressChart/PieProgressChart.js +16 -14
  8. package/dist/components/controls/Button/Button.js +6 -6
  9. package/dist/components/controls/IconButton/IconButton.d.ts +17 -2
  10. package/dist/components/controls/IconButton/IconButton.js +17 -24
  11. package/dist/components/controls/IconButton/index.d.ts +2 -2
  12. package/dist/components/controls/Input/Input.js +147 -133
  13. package/dist/components/controls/Input/styles.d.ts +2 -0
  14. package/dist/components/controls/Input/styles.js +36 -28
  15. package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +6 -6
  16. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/ActionMenuButton/ActionMenuButton.js +8 -8
  17. package/dist/components/shared/MarkdownText/MarkdownText.js +10 -10
  18. package/dist/node_modules/@highcharts/react/Highcharts.js +161 -0
  19. package/dist/node_modules/@highcharts/react/options/Title.js +14 -0
  20. package/dist/node_modules/@highcharts/react/options/Tooltip.js +14 -0
  21. package/dist/ui-kit.cjs +8 -8
  22. package/dist/utils/theme/spacing.d.ts +15 -0
  23. package/dist/utils/theme/spacing.js +15 -0
  24. package/package.json +1 -1
  25. package/dist/components/controls/IconButton/IconButton.types.d.ts +0 -11
@@ -1,55 +1,55 @@
1
- import { jsx as t, jsxs as M } from "react/jsx-runtime";
2
- import { cx as i } from "@emotion/css";
3
- import { forwardRef as B, useEffect as c, useCallback as f, useRef as D } from "react";
4
- import N from "../../../assets/svg/modal/close.svg.js";
5
- import { ModalContext as z } from "./context.js";
6
- import { styles as n } from "./styles.js";
7
- import { Portal as E } from "../Portal/Portal.js";
8
- import { Box as s } from "../Box/Box.js";
1
+ import { jsx as t, jsxs as z } from "react/jsx-runtime";
2
+ import { cx as s } from "@emotion/css";
3
+ import { forwardRef as D, useEffect as p, useCallback as d, useRef as N } from "react";
4
+ import B from "../../../assets/svg/modal/close.svg.js";
5
+ import { ModalContext as E } from "./context.js";
6
+ import { styles as i } from "./styles.js";
7
+ import { Portal as I } from "../Portal/Portal.js";
8
+ import { Box as l } from "../Box/Box.js";
9
9
  import { IconButton as P } from "../../controls/IconButton/IconButton.js";
10
- import { theme as j } from "../../../utils/theme/index.js";
11
- const C = B(
10
+ import { theme as f } from "../../../utils/theme/index.js";
11
+ const j = D(
12
12
  ({
13
13
  isOpen: o,
14
14
  onClose: r,
15
15
  overlayClassName: y,
16
- modalClassName: p,
17
- absoluteCloseButtonClassName: w,
16
+ modalClassName: w,
17
+ absoluteCloseButtonClassName: g,
18
18
  size: h = "md",
19
19
  closeOnBackdropClick: m = !0,
20
20
  closeOnEsc: u = !0,
21
- disableBodyScroll: l = !0,
22
- showAbsoluteCloseButton: g,
21
+ disableBodyScroll: a = !0,
22
+ showAbsoluteCloseButton: x,
23
23
  children: v
24
- }, x) => {
25
- c(() => {
26
- if (l && o && typeof window < "u" && typeof document < "u") {
24
+ }, k) => {
25
+ p(() => {
26
+ if (a && o && typeof window < "u" && typeof document < "u") {
27
27
  const e = window.getComputedStyle(document.body).overflow;
28
28
  return document.body.style.overflow = "hidden", () => {
29
29
  document.body.style.overflow = e;
30
30
  };
31
31
  }
32
- }, [o, l]);
33
- const d = f(
32
+ }, [o, a]);
33
+ const n = d(
34
34
  (e) => {
35
35
  e.key === "Escape" && r();
36
36
  },
37
37
  [r]
38
38
  );
39
- c(() => {
39
+ p(() => {
40
40
  if (typeof window < "u" && typeof document < "u" && u && o)
41
- return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
42
- }, [o, u, d]);
43
- const a = D(!1), k = f((e) => {
44
- a.current = e.target === e.currentTarget;
45
- }, []), b = f(
41
+ return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
42
+ }, [o, u, n]);
43
+ const c = N(!1), b = d((e) => {
44
+ c.current = e.target === e.currentTarget;
45
+ }, []), M = d(
46
46
  (e) => {
47
- m && e.target === e.currentTarget && a.current && r();
47
+ m && e.target === e.currentTarget && c.current && r();
48
48
  },
49
49
  [m, r]
50
50
  );
51
- return o ? /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(z.Provider, { value: { isOpen: o, onClose: r }, children: /* @__PURE__ */ t(
52
- s,
51
+ return o ? /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(E.Provider, { value: { isOpen: o, onClose: r }, children: /* @__PURE__ */ t(
52
+ l,
53
53
  {
54
54
  position: "fixed",
55
55
  top: 0,
@@ -59,33 +59,39 @@ const C = B(
59
59
  row: !0,
60
60
  center: !0,
61
61
  flex: 1,
62
- onMouseDown: k,
63
- onClick: b,
64
- backgroundColor: j.color.fill.bgOverlayPrimary,
65
- className: i(n.overlay, y),
62
+ onMouseDown: b,
63
+ onClick: M,
64
+ backgroundColor: f.color.fill.bgOverlayPrimary,
65
+ className: s(i.overlay, y),
66
66
  zIndex: 1,
67
- children: /* @__PURE__ */ M(
68
- s,
67
+ children: /* @__PURE__ */ z(
68
+ l,
69
69
  {
70
- ref: x,
71
- className: i(
72
- n.modal,
73
- n[`size_${h}`],
74
- p
70
+ ref: k,
71
+ className: s(
72
+ i.modal,
73
+ i[`size_${h}`],
74
+ w
75
75
  ),
76
76
  relative: !0,
77
77
  children: [
78
- g && /* @__PURE__ */ t(
79
- P,
78
+ x && /* @__PURE__ */ t(
79
+ l,
80
80
  {
81
- className: i(
82
- n.closeButton,
83
- w
84
- ),
85
- onClick: r,
86
- color: "neutral",
87
- size: "xs",
88
- children: /* @__PURE__ */ t(N, {})
81
+ position: "absolute",
82
+ top: f.spacing.lg,
83
+ right: f.spacing.lg,
84
+ zIndex: 1,
85
+ children: /* @__PURE__ */ t(
86
+ P,
87
+ {
88
+ className: g,
89
+ onClick: r,
90
+ color: "neutral",
91
+ size: "xs",
92
+ children: /* @__PURE__ */ t(B, {})
93
+ }
94
+ )
89
95
  }
90
96
  ),
91
97
  v
@@ -96,7 +102,7 @@ const C = B(
96
102
  ) }) }) : null;
97
103
  }
98
104
  );
99
- C.displayName = "Modal";
105
+ j.displayName = "Modal";
100
106
  export {
101
- C as Modal
107
+ j as Modal
102
108
  };
@@ -1,21 +1,21 @@
1
- import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as B } from "react";
3
- import W from "../../../../assets/svg/modal/close.svg.js";
4
- import { useModalContext as v } from "../context.js";
1
+ import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as v } from "react";
3
+ import B from "../../../../assets/svg/modal/close.svg.js";
4
+ import { useModalContext as W } from "../context.js";
5
5
  import { Box as t } from "../../Box/Box.js";
6
- import { theme as o } from "../../../../utils/theme/index.js";
7
- import { Text as a } from "../../Text/Text.js";
6
+ import { theme as r } from "../../../../utils/theme/index.js";
7
+ import { Text as i } from "../../Text/Text.js";
8
8
  import { IconButton as M } from "../../../controls/IconButton/IconButton.js";
9
- const j = B(
9
+ const j = v(
10
10
  ({
11
- title: i,
12
- subtitle: l,
11
+ title: l,
12
+ subtitle: a,
13
13
  w: m = "full",
14
14
  p: s,
15
- py: n,
16
- px: d = o.spacing["2xl"],
17
- pt: c = o.spacing["2xl"],
18
- pb: p = o.spacing.lg,
15
+ py: d,
16
+ px: n = r.spacing["2xl"],
17
+ pt: c = r.spacing["2xl"],
18
+ pb: p = r.spacing.lg,
19
19
  row: f = !0,
20
20
  justifyContent: h = "space-between",
21
21
  showCloseButton: g = !1,
@@ -24,57 +24,57 @@ const j = B(
24
24
  subtitleClassName: u,
25
25
  closeButtonClassName: N
26
26
  }, y) => {
27
- const { onClose: C } = v();
27
+ const { onClose: C } = W();
28
28
  return /* @__PURE__ */ e(
29
29
  t,
30
30
  {
31
31
  w: m,
32
32
  p: s,
33
- py: n,
34
- px: d,
33
+ py: d,
34
+ px: n,
35
35
  pt: c,
36
36
  pb: p,
37
37
  row: f,
38
38
  justifyContent: h,
39
39
  ref: y,
40
- borderColor: o.color.border.neutralAlphaBasic,
40
+ borderColor: r.color.border.neutralAlphaBasic,
41
41
  borderWidth: 0,
42
42
  borderBottomWidth: 1,
43
43
  borderStyle: "solid",
44
44
  className: x,
45
45
  children: [
46
- /* @__PURE__ */ e(t, { gap: o.spacing.sm, children: [
47
- /* @__PURE__ */ r(
48
- a,
46
+ /* @__PURE__ */ e(t, { gap: r.spacing.sm, children: [
47
+ /* @__PURE__ */ o(
48
+ i,
49
49
  {
50
50
  variant: "title-3",
51
51
  colorName: "primary",
52
52
  fontWeight: "semibold",
53
53
  className: b,
54
- children: i
54
+ children: l
55
55
  }
56
56
  ),
57
- /* @__PURE__ */ r(
58
- a,
57
+ /* @__PURE__ */ o(
58
+ i,
59
59
  {
60
60
  variant: "body-1",
61
61
  colorName: "tertiary",
62
62
  fontWeight: "medium",
63
63
  className: u,
64
- children: l
64
+ children: a
65
65
  }
66
66
  )
67
67
  ] }),
68
- g && /* @__PURE__ */ r(
68
+ g && /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
69
69
  M,
70
70
  {
71
71
  onClick: C,
72
72
  color: "neutral",
73
73
  className: N,
74
74
  size: "xs",
75
- children: /* @__PURE__ */ r(W, {})
75
+ children: /* @__PURE__ */ o(B, {})
76
76
  }
77
- )
77
+ ) })
78
78
  ]
79
79
  }
80
80
  );
@@ -1,7 +1,6 @@
1
1
  export declare const styles: {
2
2
  overlay: string;
3
3
  modal: string;
4
- closeButton: string;
5
4
  size_lg: string;
6
5
  size_md: string;
7
6
  size_sm: string;
@@ -1,7 +1,7 @@
1
1
  import { css as i, keyframes as a } from "@emotion/css";
2
- import { bp as t } from "../../../styles/utils/breakpoints.js";
2
+ import { bp as r } from "../../../styles/utils/breakpoints.js";
3
3
  import { theme as o } from "../../../utils/theme/index.js";
4
- const n = a`
4
+ const t = a`
5
5
  0% {
6
6
  opacity: 0;
7
7
  transform: scale(0.95);
@@ -10,29 +10,23 @@ const n = a`
10
10
  opacity: 1;
11
11
  transform: none;
12
12
  }
13
- `, l = {
13
+ `, e = {
14
14
  overlay: i({
15
15
  backdropFilter: "blur(5px)"
16
16
  }),
17
17
  modal: i({
18
18
  animationDuration: "0.2s",
19
19
  animationTimingFunction: "ease-in-out",
20
- animationName: n,
20
+ animationName: t,
21
21
  maxWidth: `calc(100vw - ${o.spacing["3xl"]})`,
22
22
  maxHeight: `calc(100vh - ${o.spacing["7xl"]} - ${o.spacing["7xl"]})`,
23
23
  borderRadius: o.cornerRadius["2xl"],
24
24
  backgroundColor: o.color.fill.bgPrimary,
25
25
  boxShadow: `0 4px 20px 0 ${o.color.effect.shadowS}`,
26
- [t.sm()]: {
26
+ [r.sm()]: {
27
27
  flex: 1
28
28
  }
29
29
  }),
30
- closeButton: i({
31
- position: "absolute",
32
- zIndex: 1,
33
- top: o.spacing.lg,
34
- right: o.spacing.lg
35
- }),
36
30
  size_lg: i({
37
31
  width: 874
38
32
  }),
@@ -44,5 +38,5 @@ const n = a`
44
38
  })
45
39
  };
46
40
  export {
47
- l as styles
41
+ e as styles
48
42
  };
@@ -6,10 +6,10 @@ import B from "../../../../assets/svg/table/chevron-right.svg.js";
6
6
  import U from "../../../../assets/svg/table/dots.svg.js";
7
7
  import { getPageNumbers as X } from "./TablePagination.utils.js";
8
8
  import { Button as M } from "../../../controls/Button/Button.js";
9
+ import { IconButton as j } from "../../../controls/IconButton/IconButton.js";
9
10
  import { Box as r } from "../../Box/Box.js";
10
11
  import { Select as Y } from "../../../controls/Select/Select.js";
11
12
  import { theme as Z } from "../../../../utils/theme/index.js";
12
- import { IconButton as j } from "../../../controls/IconButton/IconButton.js";
13
13
  import { Text as _ } from "../../Text/Text.js";
14
14
  const { color: i, cornerRadius: tt, spacing: b } = Z, bt = ({
15
15
  pageIndex: o,
@@ -1,39 +1,41 @@
1
- import { jsx as m } from "react/jsx-runtime";
1
+ import { jsx as a } from "react/jsx-runtime";
2
2
  import { cx as h } from "@emotion/css";
3
- import { Chart as b, Tooltip as C } from "@highcharts/react";
3
+ import { Chart as b } from "../../../node_modules/@highcharts/react/Highcharts.js";
4
+ import "../../../node_modules/@highcharts/react/options/Title.js";
5
+ import { Tooltip as C } from "../../../node_modules/@highcharts/react/options/Tooltip.js";
4
6
  import { useRef as T, useEffect as y, useMemo as o } from "react";
5
7
  import { buildLineChartOptions as E, buildTooltipProps as L } from "./utils.js";
6
8
  const j = ({
7
9
  color: n = "positive",
8
- data: s = [],
9
- xAxis: i,
10
- yAxis: a,
10
+ data: i = [],
11
+ xAxis: s,
12
+ yAxis: m,
11
13
  containerProps: e,
12
- highcharts: p,
14
+ highcharts: l,
13
15
  tooltip: r,
14
- className: f,
15
- style: l
16
+ className: p,
17
+ style: f
16
18
  }) => {
17
19
  const t = T(null);
18
20
  y(() => () => {
19
21
  typeof t == "object" && t?.current?.chart && t.current.chart.destroy();
20
22
  }, []);
21
- const c = o(() => E(n, s, i, a, !!r), [n, s, i, a, r]), u = o(() => r ? L(r) : { enabled: !1 }, [r]), d = o(
23
+ const c = o(() => E(n, i, s, m, !!r), [n, i, s, m, r]), u = o(() => r ? L(r) : { enabled: !1 }, [r]), d = o(
22
24
  () => ({
23
25
  ...e,
24
- className: h(e?.className, f),
25
- style: { ...e?.style, ...l }
26
+ className: h(e?.className, p),
27
+ style: { ...e?.style, ...f }
26
28
  }),
27
- [e, f, l]
29
+ [e, p, f]
28
30
  );
29
- return /* @__PURE__ */ m(
31
+ return /* @__PURE__ */ a(
30
32
  b,
31
33
  {
32
- highcharts: p,
34
+ highcharts: l,
33
35
  ref: t,
34
36
  options: c,
35
37
  containerProps: d,
36
- children: /* @__PURE__ */ m(C, { ...u })
38
+ children: /* @__PURE__ */ a(C, { ...u })
37
39
  }
38
40
  );
39
41
  };
@@ -1,6 +1,8 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { cx as p } from "@emotion/css";
3
- import { Chart as d, Title as C } from "@highcharts/react";
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { cx as l } from "@emotion/css";
3
+ import { Chart as d } from "../../../node_modules/@highcharts/react/Highcharts.js";
4
+ import { Title as C } from "../../../node_modules/@highcharts/react/options/Title.js";
5
+ import "../../../node_modules/@highcharts/react/options/Tooltip.js";
4
6
  import { forwardRef as P, useRef as y, useEffect as R, useMemo as n } from "react";
5
7
  import { buildPieProgressChartOptions as x } from "./utils.js";
6
8
  const b = P(
@@ -11,28 +13,28 @@ const b = P(
11
13
  label: a = (o) => `${o}%`,
12
14
  containerProps: t,
13
15
  className: i,
14
- style: f
15
- }, u) => {
16
- const o = y(null), r = u || o;
16
+ style: m
17
+ }, p) => {
18
+ const o = y(null), r = p || o;
17
19
  R(() => () => {
18
20
  typeof r == "object" && r?.current?.chart && r.current.chart.destroy();
19
21
  }, [r]);
20
- const h = n(() => x(e, s), [e, s]), l = n(
22
+ const u = n(() => x(e, s), [e, s]), h = n(
21
23
  () => ({
22
24
  ...t,
23
- className: p(t?.className, i),
24
- style: { ...t?.style, ...f }
25
+ className: l(t?.className, i),
26
+ style: { ...t?.style, ...m }
25
27
  }),
26
- [t, i, f]
28
+ [t, i, m]
27
29
  );
28
- return /* @__PURE__ */ m(
30
+ return /* @__PURE__ */ f(
29
31
  d,
30
32
  {
31
33
  highcharts: c,
32
34
  ref: r,
33
- options: h,
34
- containerProps: l,
35
- children: /* @__PURE__ */ m(C, { children: a?.(e) })
35
+ options: u,
36
+ containerProps: h,
37
+ children: /* @__PURE__ */ f(C, { children: a?.(e) })
36
38
  }
37
39
  );
38
40
  }
@@ -5,10 +5,10 @@ import { useMemo as o } from "react";
5
5
  import { cornerRadiusValues as u, baseButton as D, getVariantStyles as E, typeStyles as G, sizeValues as H } from "./styles.js";
6
6
  import { Loader as I } from "../../builders/Loader/Loader.js";
7
7
  import { AnimatedText as J } from "../../builders/Text/Text.js";
8
- import { Ripple as K } from "../../builders/Ripple/Ripple.js";
9
- import { theme as P } from "../../../utils/theme/index.js";
10
- import { Box as Q } from "../../builders/Box/Box.js";
11
- const { color: m } = P, ue = ({
8
+ import { theme as K } from "../../../utils/theme/index.js";
9
+ import { Box as P } from "../../builders/Box/Box.js";
10
+ import { Ripple as Q } from "../../builders/Ripple/Ripple.js";
11
+ const { color: m } = K, ue = ({
12
12
  disabled: n,
13
13
  loading: l,
14
14
  className: g,
@@ -95,7 +95,7 @@ const { color: m } = P, ue = ({
95
95
  }
96
96
  }, [s]);
97
97
  return /* @__PURE__ */ a(
98
- Q,
98
+ P,
99
99
  {
100
100
  className: y(S, g),
101
101
  w: h,
@@ -131,7 +131,7 @@ const { color: m } = P, ue = ({
131
131
  ),
132
132
  R
133
133
  ] }),
134
- /* @__PURE__ */ a(K, {})
134
+ /* @__PURE__ */ a(Q, {})
135
135
  ]
136
136
  }
137
137
  )
@@ -1,2 +1,17 @@
1
- import { IIconButtonProps } from './IconButton.types';
2
- export declare function IconButton({ attr, children, className, type, color, size, ...props }: IIconButtonProps): import("react/jsx-runtime").JSX.Element;
1
+ import { ComponentProps } from 'react';
2
+ import { CustomType, NegativeType, NeutralType, PositiveType, PrimaryType, SecondaryType, Size, TransferType, WarningType } from '../../../types/tokens.types';
3
+ export type IconButtonSize = Extract<Size, "xs" | "sm" | "md"> | CustomType;
4
+ export type IconButtonColor = PrimaryType | SecondaryType | NegativeType | PositiveType | WarningType | TransferType | NeutralType | CustomType | "neutral-white" | "no-bg";
5
+ export interface IconButtonProps extends ComponentProps<"button"> {
6
+ /**
7
+ * Размер кнопки.
8
+ * @default "md"
9
+ */
10
+ size?: IconButtonSize;
11
+ /**
12
+ * Цветовая схема (токен).
13
+ * @default "primary"
14
+ */
15
+ color?: IconButtonColor;
16
+ }
17
+ export declare function IconButton({ children, className, type, color, size, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,35 +1,28 @@
1
- import { jsxs as l, jsx as n } from "react/jsx-runtime";
2
- import p from "classnames";
3
- import { Ripple as c } from "../../builders/Ripple/Ripple.js";
4
- import { styles as a, sizeStyles as f, colorStyles as u } from "./styles.js";
5
- function j({
6
- attr: o,
7
- children: t,
8
- className: r,
9
- type: s = "button",
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import { cx as p } from "@emotion/css";
3
+ import { styles as l, sizeStyles as c, colorStyles as f } from "./styles.js";
4
+ import { Ripple as u } from "../../builders/Ripple/Ripple.js";
5
+ function d({
6
+ children: o,
7
+ className: t,
8
+ type: r = "button",
10
9
  color: m = "primary",
11
- size: e = "md",
12
- ...i
10
+ size: s = "md",
11
+ ...e
13
12
  }) {
14
- return /* @__PURE__ */ l(
13
+ return /* @__PURE__ */ i(
15
14
  "button",
16
15
  {
17
- ...o,
18
- ...i,
19
- type: s,
20
- className: p(
21
- a,
22
- f[e],
23
- u[m],
24
- r
25
- ),
16
+ ...e,
17
+ type: r,
18
+ className: p(l, c[s], f[m], t),
26
19
  children: [
27
- /* @__PURE__ */ n(c, {}),
28
- t
20
+ /* @__PURE__ */ n(u, {}),
21
+ o
29
22
  ]
30
23
  }
31
24
  );
32
25
  }
33
26
  export {
34
- j as IconButton
27
+ d as IconButton
35
28
  };
@@ -1,2 +1,2 @@
1
- export * from './IconButton';
2
- export type * from './IconButton.types';
1
+ export type { IconButtonColor, IconButtonProps, IconButtonSize, } from './IconButton';
2
+ export { IconButton } from './IconButton';